import * as React from 'react';
import * as react from 'React';
import * as Global from '../TS/Global';
export interface MybtnProps extends Global.Myprops {

    //name:string;

};

interface MybtnState {
    count : number;
};

export class Mybtn extends React.Component < MybtnProps,
MybtnState > {
    displayName : string;
    XXX : string = "Mybtnxxx";
    constructor(props : any) {
        super(props);
        this.displayName = this.props.displayName;
        this.state = {
            count: 0
        };
    }

    public handleClick(e : React.MouseEvent < HTMLButtonElement >) : void {

        this.setState((prv, prop) => ({
            count: this.state.count + 1
        }));
        console.log("点击" + this.state.count);

        this
            .props
            .OnMessageSendEvent(this, '', "xx", e);
    }

    public render() : JSX.Element {return(
            <button
                type="button"
                className="btn btn-default"
                onClick={e => this.handleClick(e)}>button sccs
            </button>

        );}
}

export default Mybtn;
